package service;

import bean.Car;
import bean.Items;
import bean.Orders;
import bean.Users;
import com.alibaba.druid.sql.ast.statement.SQLCreateTriggerStatement;

import java.sql.Date;
import java.sql.Time;
import java.util.List;

/**
 * @author 栋
 * @date 2022/11/14
 * @description
 */
public interface UserService {
    /**
     * 处理登录业务，成功则返回该用户信息，否则返回null
     * @param phoneNumber
     * @param pwd
     * @return
     */
    public Users login(String phoneNumber,String pwd);

    /**
     * 处理注册业务
     * @param u
     * @return
     */
    public boolean register(Users u);

    /**
     * 处理浏览商品业务
     * @return
     */
    public List<Items> showItems();

    /**
     * 申请上架商品
     * @return
     */
    public void applicationItems(Items item);

    /**
     * 实名认证
     * @param user
     * @param name
     * @param number
     * @param pwd
     * @param credit_number
     * @param cre_pwd
     * @return
     */
    public boolean realName(Users user,String name,String number,String pwd,String credit_number,String cre_pwd);

    /**
     * 获取商品信息
     * @param item_id
     * @return
     */
    public Items showItemInfor(String item_id);

    /**
     * 获取个人商品信息
     * @param user_id
     * @return
     */
    public List<Items> showPersonalItems(String user_id);

    /**
     * 更新信息
     * @param user
     * @return
     */
    public boolean updateInfor(Users user);

    /**
     * 删除商品
     * @param item_id
     * @return
     */
    public int deleteItem(String item_id);

    /**
     * 通过类型获取商品
     * @param type
     * @return
     */
    public List<Items> showItemsByType(int type);


    public List<Items>showItemsSearch(String name);

    public String buyItems(Orders orders,String credit_number,String pwd);

    public String payAll(Users user, Car car, String credit_pwd, Date date, Time time);

    public List<Orders>showOrders(String user_id,String option);

    public void confirmOrder(String order_id);

    public boolean isInBlacklist(String user_id);
}
